<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/include/taglib.jsp" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="decorator" content="default" />
	<script type="text/javascript">
        var GOBAL_CUST_ROLENO = '<shiro:principal property="roleNo"/>'; //当前用户角色
        var empNo = "${param.empNo}";
    </script>
</head>
<body>
<script>
var datatable;
var prjName;
//查询
function queryPrj() {
	
	var oSettings = datatable.fnSettings();
	oSettings._iDisplayStart = 0;
	datatable.fnClearTable(0); //清空数据
	datatable.fnDraw(); //重新加载数据 
}


//查看 
function viewPrj(id){
	window.location.href="step.jsp?prjId="+id;
}

//查看审核信息
function viewComment(btn,row,prjName,showName){
	$("#submit-name").html(prjName);
	$("#comments").html(row);
	$("#task-name").html(showName);
	showModalFollowRight(btn,"audit-message");
}


//右侧显示modal
function showModalFollowRight(btn,modal){
	var modalObj = getJqueryObj(modal);
	
	modalObj.modal();
	setModelFollowRight(modalObj,"500px");
}
//模糊查询数据
function queryObscurePrj(){
	
	queryPrj();
	
}

function baseQuery(){
	var prjTableColums = [//定义列
	                      {
	          				"mData":"uuid",
	          				"sClass": "center",
	          				"bSortable": false,
	          				"mRender" : function(data, type, row) {	          					
	          						return '<div class="action-buttons"><span class="vbar"></span> <a  href="javascript:viewPrj(\''+row.prjId+'\')"><i class="icon-eye-open bigger-130"></i></a></div>';
	          				}
	                      },
	                      {
	                    	  "mData":"showName",
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData": "submitEmpNo",
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData":"createDt",
	                    	  "mData": function(data, type, row) {
	          					return DateUtil.dateFormat(data.createDt);
	          				  },
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData": "submitType",
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData": "prjName",
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData":"status",
	                    	  "sClass": "center",
	                    	  "bSortable": false
	                      },
	                      {
	                    	  "mData": "comment",
                    	      "sClass": "center",
	          				  "bSortable": false,
	          				  "mRender" : function(data, type, row) {
	          					return '<div class="action-buttons"><span class="vbar"></span> <a  href="javascript:viewComment(this,\''+data+'\',\''+row.prjName+'\',\''+row.showName+'\')"><i class="icon-comment bigger-130">点击查看</i></a></div>';
	          			      }
	                      }
	              ];
	          	
	              //初始化dataTable
	          	datatable = $('#prjTable').dataTable( {
	              	'sAjaxSource': '${ctx}/pm/comment/querySubmitInfo.do',	//请求数据源 
	              	"fnServerData": function(sSource, aoData, fnCallback,oSettings){
	            		$.extend(aoData,$('#prj_name').serializeArray());
	            		$.ajax({
	        	    		dataType: 'json',
	        	    		url : sSource,
	        	    		data: aoData,
	        	    		success: fnCallback
	            		});		
	              	},
	          		'bServerSide':true,							//是否启动服务器端数据导入
	          		"bLengthChange" : false,
	          		"bInfo" : true,
	          		"bPaginate" : true,
                  	'bFilter': false,                       	//是否使用内置的过滤功能。
                  	'aoColumns': prjTableColums,
                 	"sDom": '<"toolbar">frtip', 
                   	"oLanguage": oLanguage
	          	});             
}

$(document).ready(function() {
	//$('#prjQueryForm').bootstrapValidator();
	//$('#roleSaveForm').data('bootstrapValidator').validate();
	baseQuery();
	initAuth();
	
});
</script>

<!-- 审核信息详情模板 -->
            <div class="modal fade in" id="audit-message"><!-- class="modal fade" 添加效果 -->
                <div class="modal-dialog" style="width:600px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">审核信息</h4>
                        </div>
                        <div class="modal-body">
                            <p >审核内容:&nbsp;&nbsp;<font size="4"><span id="submit-name"></span></font>&nbsp;&nbsp;<font size="3"><span id="task-name"></span></font></p>
                            <div >
                            	<font size="3.5"><span id="comments"></span></font>
                            </div>    	
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>

<div class="row row-default border-ra2">
	<div class="col-sm-12">
		<div class="row row-tt">
			<div class="col-sm-4">
				<h3 class="header header-default">
					审核信息列表
				</h3>
			</div>
			<div class="col-sm-5">		
				
				<form class="form-horizontal" role="form" name="prjQuery" id="prjQueryForm" action="" method="get">
					<div class="input-group">
						<tags:select type="auditStatus" name="prj_name" id="prj_name" hasBlank="true"></tags:select>
						<span class="input-group-btn">
							<button type="button" class="btn btn-sm btn-info" onclick="queryObscurePrj();"><i class="icon-search"></i>查询</button>
							<button class="btn btn-sm btn-default" type="reset"><i class="icon-undo"></i>重置</button>
						</span>
					</div>
				</form>
			</div>
			
		</div>
			
		<div class="row row-content">
			<div class="col-xs-12">
				<div class="table-responsive">
					<table id="prjTable" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th width="10%"></th>
								<th width="15%">审核内容</th>
								<th width="10%">提交人</th>
								<th width="15%">提交时间</th>
								<th width="10%">审核类型</th>
								<th width="15%">所属项目</th>
								<th width="10%">状态</th>
								<th width="15%">审核意见</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
		</div>
							
	</div>
</div>
</body>
